package com.fhx.core.utils

import android.content.Context
import android.text.TextUtils
import android.widget.Toast
import com.fhx.core.AppContext

object ToastUtils {
    fun show(res:Int){
       if (res>0){
           show(AppContext.instance.resources.getString(res))
       }
    }
    fun show(msg:String){
        if (!OtherTool.isEmpty(msg)){
            Toast.makeText(AppContext.instance,msg,Toast.LENGTH_SHORT).show()
        }
    }

    fun show(context: Context,msg:String){
        if (!OtherTool.isEmpty(msg)){
            Toast.makeText(context,msg,Toast.LENGTH_SHORT).show()
        }
    }

    fun showNetUnAvailableToast(){
        Toast.makeText(AppContext.instance,"网络不可用",Toast.LENGTH_SHORT).show()
    }
}